<script type="text/javascript"/>	
	function isNumber(str) {
		var tmp = str.trim();
		var regex = /^[1-9]\d*(.[1-9])*$/;
		if (regex.test(tmp)) {
			return true;
		}
		return false;
	}
	
	function saveCheck() {
		if ($F("detail.doctor.id") == "0") {
			addInputErrorMessage($("detail.doctor.id"), "请选择姓名！");
			return false;
		} else {
			clearInputState($("detail.doctor.id"));
		}
		
		if ($F("detail.date").trim() == "") {
			addInputErrorMessage($("detail.date"), "请选择加班日期！");
			return false;
		}
		if ($F("detail.overtimeHours").trim() == "") {
			addInputErrorMessage($("detail.overtimeHours"), "请填写加班时间！");
			return false;
		}
		if (!isNumber($F("detail.overtimeHours"))) {
			addInputErrorMessage($("detail.overtimeHours"), "请填写大于0的数字！");
			return false;
		}
	/*
		var activeDate = $F('effectiveTime');
		var inActiveDate = $F('inEffectiveTime');	
		var nowStr = getNowStr();
		
		if (getRadioValue() == "false") {
			if (activeDate != "" && activeDate <= nowStr) {
				addInputErrorMessage($("effectiveTime"), "<@ww.text name="superadmin.input.check.activedate"/>");
				return false;
			}
		}
		
		if (inActiveDate != "" && inActiveDate <= nowStr) {
			addInputErrorMessage($("inEffectiveTime"), "<@ww.text name="superadmin.input.check.inactivedate"/>");
			return false;
		}
		
		*/
		return true;
	}	

	function getNowStr() {
		var now = new Date();
		var year = now.getFullYear();
		var month = (now.getMonth() + 1).toString().length == 1 ? ("0" +(now.getMonth() + 1).toString()): (now.getMonth() + 1).toString();
		var day = now.getDate().toString().length == 1 ? ("0" + now.getDate().toString()) : now.getDate().toString();
		return year + "-" + month + "-" + day;
	}
	
	function getRadioValue() {
		var result = "";
		$$('input[type="radio"][name="site.status"]')
			.select(function(i){return i.checked})
			.each(function(i){result = i.value});
		return result;    
	}
	
	function changeEffective(value) {
		clearAllInputItem();
		
		if (value == "true") {
			$("effectiveTime").disabled = true;
			$("inEffectiveTime").disabled = false;
			$("effectiveTime").value = "";
		} else {
			$("effectiveTime").disabled = false;
			$("inEffectiveTime").disabled = false;
		}
	}
</script>